import request from "../utils/request";

export function getUser(id) {
    return request.get('/users/' + id);
}

export function getUsers(page = 1, pageSize = 15, keyword = '') {
    return request.get('/users', {
        params: {page, pageSize, keyword}
    })
}

export function addUser(user) {
    return request.post('/users', user);
}

export function deleteUser(id) {
    return request.delete('/users', {
        params: {id}
    })
}

export function updateUser(user) {
    return request.patch('/users', user);
}
